using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Controller;

namespace Cliente.Forms
{
    public partial class ucEndereco : UserControl
    {
        public ucEndereco()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.btnLocate.Enabled = false;

            Controller.Endereco oEnd = new Controller.Endereco();
            DataRow dtEnd = oEnd.EnderecoPorCep(this.tbxCep.Text);
            this.tbxRua.Text = dtEnd["logradouro"].ToString();
            this.tbxBairro.Text = dtEnd["bairro"].ToString();
            this.tbxEstado.Text = dtEnd["uf"].ToString();
            this.tbxCidade.Text = dtEnd["localidade"].ToString();
            this.btnLocate.Enabled = true;
        }
    }
}
